<?php
if(isset($_GET["action"]))
    
$connection = mysqli_connect('localhost','root','','tripviet') or die('Could not connect to DB');
$start =1;
$display=4;
//get the number the images in the sever
$query = "SELECT id,
            name,
            path
            FROM gallery                    
            LIMIT $start, $display";
$result = mysqli_query($connection,$query) or die('Could not select users '.mysqli_error($connection));

while($set = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
                                $name = $set['name'];
                                $path = $set['path'];
                                $id = $set['id'];
                                
                                $sReturn = $id.'-'.$name.'-'.$path;
                                echo $sReturn;
                            }                           
?>